import 'package:p_location/map/obj/risk_zone_point.dart';
import 'package:p_location/map/obj/risk_zone_rail.dart';

class RiskZoneInfo {
    RiskZoneRail podRiskRail;
    List<RiskZonePoint> points;

    RiskZoneInfo({this.podRiskRail, this.points});

    factory RiskZoneInfo.fromJson(Map<String, dynamic> json) {
        return RiskZoneInfo(
            podRiskRail: json['podRiskRail'] != null ? RiskZoneRail.fromJson(json['podRiskRail']) : null,
            points: json['points'] != null ? (json['points'] as List).map((i) => RiskZonePoint.fromJson(i)).toList() : null,
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        if (this.podRiskRail != null) {
            data['podRiskRail'] = this.podRiskRail.toJson();
        }
        if (this.points != null) {
            data['points'] = this.points.map((v) => v.toJson()).toList();
        }
        return data;
    }
}